package com.ruoyi.cqjd.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cqjd.mapper.CqjdCategoryMapper;
import com.ruoyi.cqjd.domain.CqjdCategory;
import com.ruoyi.cqjd.service.ICqjdCategoryService;

/**
 * 菜品分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-21
 */
@Service
public class CqjdCategoryServiceImpl implements ICqjdCategoryService 
{
    @Autowired
    private CqjdCategoryMapper cqjdCategoryMapper;

    /**
     * 查询菜品分类
     * 
     * @param id 菜品分类主键
     * @return 菜品分类
     */
    @Override
    public CqjdCategory selectCqjdCategoryById(Long id)
    {
        return cqjdCategoryMapper.selectCqjdCategoryById(id);
    }

    /**
     * 查询菜品分类列表
     * 
     * @param cqjdCategory 菜品分类
     * @return 菜品分类
     */
    @Override
    public List<CqjdCategory> selectCqjdCategoryList(CqjdCategory cqjdCategory)
    {
        return cqjdCategoryMapper.selectCqjdCategoryList(cqjdCategory);
    }

    /**
     * 新增菜品分类
     * 
     * @param cqjdCategory 菜品分类
     * @return 结果
     */
    @Override
    public int insertCqjdCategory(CqjdCategory cqjdCategory)
    {
        return cqjdCategoryMapper.insertCqjdCategory(cqjdCategory);
    }

    /**
     * 修改菜品分类
     * 
     * @param cqjdCategory 菜品分类
     * @return 结果
     */
    @Override
    public int updateCqjdCategory(CqjdCategory cqjdCategory)
    {
        return cqjdCategoryMapper.updateCqjdCategory(cqjdCategory);
    }

    /**
     * 批量删除菜品分类
     * 
     * @param ids 需要删除的菜品分类主键
     * @return 结果
     */
    @Override
    public int deleteCqjdCategoryByIds(Long[] ids)
    {
        return cqjdCategoryMapper.deleteCqjdCategoryByIds(ids);
    }

    /**
     * 删除菜品分类信息
     * 
     * @param id 菜品分类主键
     * @return 结果
     */
    @Override
    public int deleteCqjdCategoryById(Long id)
    {
        return cqjdCategoryMapper.deleteCqjdCategoryById(id);
    }

    @Override
    public List<CqjdCategory> selectCqjdCategoryList() {
        return cqjdCategoryMapper.getCategoryList();
    }
}
